var users = "";
var Search = {
    
	showPerson: function() {
	    users = GetLS("searchUser");
	    for (var i=0; i<users.length; ++i) {
        var html = '<div class="ub up_list detailEvt" ontouchstart="zy_touch()" onclick=Search.detail(' + i + ')>'+
                                '    <div class="uw3 uh3 ub_img_cover detailEvt" style="background-image:url('+ Core.id2url(users[i]) +')"></div>'+
                                '    <div class="ub-f1 ub ub-ver upl_p5">'+
                                '        <div class="ub-f1 ub">'+
                                '            <div class="ub-f1 ub_left">'+ users[i].name +'　'+ (users[i].sex?users[i].sex:'') + ' '+ (users[i].country?users[i].country:'') +'</div>'+
                                '        </div>'+
                                '        <div class="ub_left ub-f1">'+(CurrentUser.category==30?"电话:":"Phone：")+''+users[i].phone  +'</div>'+
                                '    </div>'+ 
                                '</div>';
        }
        $("#search").html(html);
         //清除缓存
        ClearLS("searchUser");
	},
	detail:function(i) {
	  var item =  users[i];
	  SetLS("search_detail", item);
      OpenNewWin("search_detail");
	},
	detailInit: function() {
        //var item =  users[i];
        var friend = GetLS("search_detail");
        $("#id").text(friend._id);
        $("#photo").css("background-image", "url("+ Core.id2url(friend) +")");
        $("#name").text(friend.name +"　"+ (friend.sex?friend.sex:""));
        $("#phone").text(CurrentUser.category==30?"电话:"+friend.phone:"Phone:"+friend.phone);
        var wu=CurrentUser.category==30?"无":"No";
        $("#country").text(CurrentUser.category==30?"国家:"+ (friend.courntry?friend.courntry:wu):"Country:"+ (friend.courntry?friend.courntry:wu));
        //$("#country").text(CurrentUser.category==30?"国家:":"Country:"+ (friend.courntry?friend.courntry:"无"));
        $("#interest").text(CurrentUser.category==30?"爱好:"+ (friend.interest?friend.interest:wu):"Interest:"+ (friend.interest?friend.interest:wu));
        
        
    },
}